#include "masterPutCycleHost.h"
#include <stdlib.h>
int main(){
	MasterMachine mean;
	union{
		uint16_t data[100];
		uint8_t bridge[200];
	} dati;
	uint16_t itera;
	initData InitContent; //da inizializzare a livello di main
	Event masterPutCycleHostInitEvent={INIT_CODE,&InitContent}; //evento di init "concreto" rispetto alla controparte astratta
	Event innerRxEvent={HAND_SHAKE_MACHINE_RX_EVENT_CODE,NULL};
	Event innerTimeOut={HAND_SHAKE_MACHINE_TIMEOUT_EVENT_CODE,NULL};
	for (itera=0;itera<100;itera++)
		dati.data[itera]=itera;
	InitContent.pPacket=10; //specifica quanti dati inviare
	InitContent.contentBuffer=&dati; //punta buffer
	stateMachineOnInit2(&mean,masterPutCycleHostInitTransactionState,&masterPutCycleHostInitEvent); //parti
	stateMachineDispatcher(&mean.microCycleHandler,&innerTimeOut);
	stateMachineDispatcher(&mean.microCycleHandler,&innerRxEvent);
	for (itera=0;itera<10;itera++)
		stateMachineDispatcher(&mean.microCycleHandler,&innerRxEvent);
	stateMachineOnInit2(&mean,masterPutCycleHostInitTransactionState,&masterPutCycleHostInitEvent); //riparti
	for (itera=0;itera<10;itera++)
			stateMachineDispatcher(&mean.microCycleHandler,&innerTimeOut);
	while(1)
	{
		;
	}

}
